home *** CD-ROM | disk | FTP | other *** search
- #include "stdafx.h"
-
- int debug = FALSE;
-
- void write_debug(cDisplayable *list)
- {
- for (; list != 0; list = (cDisplayable *)list->next)
- if (list->surface_visible())
- {
- int x = list->x, y = list->y;
-
- if (list->orig != 0)
- {
- rect(list->surface, x + list->orig->bbox.x1, y - list->orig->bbox.y1, x + list->orig->bbox.x2, y - list->orig->bbox.y2, yellow);
-
- for (cBox *b = list->orig->box; b != 0; b = (cBox *)b->next)
- rect(list->surface, x + b->x1, y - b->y1, x + b->x2, y - b->y2, gray);
-
- for (cLine *l = list->orig->line; l != 0; l = (cLine *)l->next)
- line(list->surface, x + l->x1, y - l->y1, x + l->x2, y - l->y2, gray);
-
- for (cCircle *c = list->orig->circle; c != 0; c = (cCircle *)c->next)
- circle(list->surface, x + c->x, y - c->y, c->radius, gray);
-
- for (cSpot *s = list->orig->spot; s != 0; s = (cSpot *)s->next)
- rectfill(list->surface, x + s->x + 1, y - s->y - 1, x + s->x - 1, y - s->y + 1, gray);
- }
-
- for (cCircle *c = list->circle_bounds; c != 0; c = (cCircle *)c->next)
- circle(list->surface, x + c->x, y - c->y, c->radius, white);
-
- for (cLine *l = list->line_bounds; l != 0; l = (cLine *)l->next)
- line(list->surface, x + l->x1, y - l->y1, x + l->x2, y - l->y2, white);
-
- rectfill(list->surface, x - 1, y - 1, x + 1, y + 1, red);
- }
- }
-
- void write_debug_info()
- {
- if (debug)
- {
- for (int i = 0; objtypes[i].type != 0; i++)
- if (!objtypes[i].list_occured_earlier)
- write_debug(*objtypes[i].onscreen);
-
- write_debug(players);
- }
- }
-